def count(s,ch):
    n = 0
    for c in s:
        if c== ch:
            n += 1
    return n

def main():
    s = input("请输入字符串：")
    ch = input('请输入要查看的字符：')

    print(count(s,ch))
    print(s.count(ch))

main()